<?php
error_reporting( E_ALL&~E_NOTICE );
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;

StaticService::includeAppCssStatic(GlobalUrlService::buildStaticUrl('/css/uniform/css/uniform.default.css'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/content/ckeditor.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.config.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.all.min.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/lang/zh-cn/zh-cn.js'),AdminAsset::class);
?>

<div class="widget">
    <div class="widget-title">
        <h4><i class="icon-reorder"></i>查看文章</h4>
    </div>
    <div class="widget-body form">
        <!-- BEGIN FORM-->
        <form action="#" class="form-horizontal">
            <div class="control-group">
                <label class="control-label">文章标题</label>
                <div class="controls">
                    <input type="text" class="span6 menu-name" name="menu_name" value="<?= $data['title'];?>">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">文章类型</label>
                <?php if ($data['type']==1){ ?>
                <div class="controls">
                    <input type="text" class="span6 menu-addr" name="url" value="关于我们">
                </div>
                <?php } ?>
                <?php if ($data['type']==2){ ?>
                    <div class="controls">
                        <input type="text" class="span6 menu-addr" name="url" value="常见问题">
                    </div>
                <?php } ?>
                <?php if ($data['type']==3){ ?>
                    <div class="controls">
                        <input type="text" class="span6 menu-addr" name="url" value="免责声明">
                    </div>
                <?php } ?>
            </div>
            <div class="control-group">
                <label class="control-label">文章内容</label>
                <div class="controls">
                    <script id="editor" type="text/plain" style="width:100%;height: 400px"  class="content"><?= $data['content'];?></script>
                </div>
            </div>
            <div class="form-actions">
                <a href="<?= GlobalUrlService::buildAdminUrl('content/content')?>" ><button type="button" class="btn btn-last-cancel" style="margin-left:100px;">返回</button></a>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
